<?php
class S3Bucket {
	public $bucket = null;
	//public $createDate = null;
	private $s3;
	public $acl;
	public $versioning;
	public $size;
	public $objectCount;
	
	public function __construct($bucket = null) {
		if (is_null($bucket)) {
			throw new Exception ("Expected bucket name param1");
		}
		$this->bucket = $bucket;
		$this->s3 = new S3Utils($this->bucket);
		if (!$this->s3->bucketExist()) {
			$this->s3->bucketCreate();
			$this->s3->bucketEnableVersioning();
		}
		
		// Load up bucket data...
		$this->acl = $this->s3->getBucketACL();
		$this->versioning = $this->s3->bucketIsVersioningEnabled();
		$this->size = $this->s3->bucketSize();
		$this->objectCount = $this->s3->bucketObjectCount();
		return true;
	}
}
?>